import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity } from 'typeorm';
import { BaseEntity } from '../../../base.entity';

@Entity({ name: 'gather_machine_parameter' })
export default class GatherMachineParameter extends BaseEntity {
  @Column({ type: 'varchar', length: 50, name: 'access_code', comment: '接入编码' })
  @ApiProperty()
  accessCode: string;

  @Column({ type: 'float', name: 'parameter_id', nullable: true, comment: '采集编码' })
  @ApiProperty()
  parameterId: number;

  @Column({ type: 'float', name: 'slave_id', nullable: true, comment: '从机地址' })
  @ApiProperty()
  slaveId: number;

  @Column({ type: 'float', name: 'start_offset', nullable: true, comment: '起始位' })
  @ApiProperty()
  startOffset: number;

  @Column({ type: 'float', name: 'address', nullable: true, comment: '地址' })
  @ApiProperty()
  address: string;

  @Column({
    type: 'varchar',
    length: 50,
    name: 'fins_address',
    nullable: true,
    comment: 'fins地址',
  })
  @ApiProperty()
  finsAddress: string;

  @Column({ type: 'varchar', length: 50, name: 'type', nullable: true, comment: '数据类型' })
  @ApiProperty()
  type: string;

  @Column({ type: 'float', name: 'leng', nullable: true, comment: '长度' })
  @ApiProperty()
  leng: number;

  @Column({ type: 'float', name: 'decimal_places', nullable: true, comment: '小数位' })
  @ApiProperty()
  decimalPlaces: number;

  @Column({ type: 'varchar', name: 'byte_order', nullable: true, comment: '字节序' })
  @ApiProperty()
  byteOrder: string;

  @Column({ type: 'varchar', name: 'bit_access_code_obj', nullable: true, comment: 'bit匹配对象' })
  @ApiProperty()
  bitAccessCodeObj: string;

  @Column({ type: 'varchar', name: 'computed_type', nullable: true, comment: '计算公式' })
  @ApiProperty()
  computedType: string;

  @Column({ type: 'float', name: 'computed_num', nullable: true, comment: '计算值' })
  @ApiProperty()
  computedNum: number;

  @Column({ type: 'float', name: 's7_address', nullable: true, comment: 's7地址' })
  @ApiProperty()
  s7Address: string;

  @Column({ type: 'float', name: 'opcua_address', nullable: true, comment: 'opcua地址' })
  @ApiProperty()
  opcuaAddress: string;

  @Column({ type: 'float', name: 'opcua_type', nullable: true, comment: 'opcua数据类型' })
  @ApiProperty()
  opcuaType: string;

  @Column({ type: 'varchar', nullable: true, comment: '备注' })
  @ApiProperty()
  remark: string;
}
